package com.wxyzz.canteenadmin.order.orderDetails.service.impl;

import com.wxyzz.canteenadmin.order.orderDetails.mapper.OrderDetailsMapper;
import com.wxyzz.canteenadmin.order.orderDetails.service.OrderDetailsService;
import com.wxyzz.canteenadmin.order.orderDetails.vo.OrderDetailsVo;
import com.wxyzz.canteencommon.exception.CustmerException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrderDetailsServiceImpl implements OrderDetailsService {
    @Resource
    private OrderDetailsMapper orderDetailsMapper;

    @Override
    // 返回订单详细信息
    public List<OrderDetailsVo> getOrderDetail(String orderNumber) {
        List<OrderDetailsVo> orderDetailsVo = orderDetailsMapper.selectOrderDetail(orderNumber);
        if (orderNumber == null) {
            throw new CustmerException("订单信息不存在");
        }
        return orderDetailsVo;
    }
}
